<template>
  <div>
    <p class="title">用户列表</p>
    <div class="main">
      <div class="he">
        <div class="box1">
          <div>
            <span>是否认证：</span>
            <el-select v-model="value1" placeholder="全部" size="small">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>

             <div class="lstse">
          <span>状态：</span>
          <el-select v-model="value4" placeholder="全部" size="small">
            <el-option
              v-for="item in options4"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>
          <!-- <div>
            <span>是否会员：</span>
            <el-select v-model="value2" placeholder="全部" size="small">
              <el-option
                v-for="item in options2"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div>
            <span>用户类型：</span>
            <el-select v-model="value3" placeholder="全部" size="small">
              <el-option
                v-for="item in options3"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>-->
        </div> 
        <div class="box2 el-icon-search">
          <input v-model="input" placeholder="搜索昵称手机号" />
        </div>

       
      </div>
      <el-button type="primary" @click="add">新建用户</el-button>
    </div>

    <!-- 表格 -->

    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="num" label="序号" width="180"> </el-table-column>

      <el-table-column prop="username" label="用户名称" show-overflow-tooltip width="100">
      </el-table-column>
      <el-table-column prop="phone" label="手机号" show-overflow-tooltip width="200">
      </el-table-column>
      <el-table-column prop="authentication" show-overflow-tooltip label="是否认证">
      </el-table-column>
      <el-table-column prop="login" show-overflow-tooltip label="最近登录"> </el-table-column>

      <el-table-column prop="state" show-overflow-tooltip label="状态"> </el-table-column>

      <el-table-column prop="operate" show-overflow-tooltip label="操作" @click="del(1)" width="180">
        <template slot-scope="scope">
          <el-button @click="handleClickWC(scope.row)" type="text" size="small"
            >查看</el-button
          >
          <el-button @click="publish(scope.row)" type="text" size="small"
            >发布</el-button
          >
          <el-button @click="tj(scope.row)" type="text" size="small"
            >编辑</el-button
          >
          <el-button @click="qxtj(scope.row)" type="text" size="small"
            >冻结</el-button
          >
         
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400"
    >
    </el-pagination>
  </div>
</template>

<script>
import Page from "../../components/page.vue";
import apis from "../../apis/modules/userAdmin";
export default {
   components: {
    Page,
  },
  data() {
    return {
      pageNumber:1,
      pageSize:10,
      // 是否认证
      options: [
        {
          value: "all",
          label: "全部",
        },
        {
          value: "0",
          label: "未认证",
        },
        {
          value: "1",
          label: "待审核",
        },
        {
          value: "2",
          label: "审核通过",
        },
        {
          value: "3",
          label: "审核失败",
        },
      ],
      value1: "all",
      // // 是否会员
      // options2: [
      //   {
      //     value: "3",
      //     label: "审核失败",
      //   },
      // ],
      // value2: "",
      // //   用户类型
      // options3: [
      //   {
      //     value: "选项1",
      //     label: "黄金糕",
      //   },
      // ],
      // value3: "",
      //   搜索
      input: "",
        // 状态
      options4: [
        {
          value: "all",
          label: "全部",
        },
        {
          value: "1",
          label: "正常",
        },
        {
          value: "2",
          label: "冻结",
        },
        {
          value: "3",
          label: "注销",
        },
      ],
      value4: "all",

      //   表格、
      tableData: [],
      currentPage: 1,
    };
  },
  mounted(){
    this.getMangerVestUserinfo({
       
         auth:this.value1,
         state:this.value4,
       pageNumber: this.pageNumber,
       pageSize:this.pageSize
    })
  },
  methods: {
    //   
//获取活动列表  
async getMangerVestUserinfo(data){
await apis.getMangerVestUserinfo(data).then(res=>{
  console.log(res);
})
},
    //新建 动态组件
    add() {
     this.$router.push("/Home/AddUser")
    },
    //编辑 动态组件
    tj(data) {
      this.$router.push("/Home/AddUser")
    },
    qxtj(data) {
      this.$confirm("是否取消", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$message({
            type: "success",
            message: "取消推荐成功!",
          });
          data.done = true;
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消当前操作",
          });
        });
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    handleClickWC() {
      this.$router.push("/home/CheckUser");
    },
    publish(data) {
      this.$router.push("/home/Publish");
    },
  },
};
</script>

<style lang="scss" scoped>

.title {
  margin-top: -10px;
  font-size: 14px;
}
.main {
  padding: 20px;
}
.el-input--small .el-input__inner {
  height: 32px;
  line-height: 32px;
  width: 126px;
}
.he {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  .box1 {
    width: 800px;
    display: flex;
    justify-content: space-between;
    > div {
      display: flex;
      span {
        width: 100px;
        line-height: 30px;
      }
    }
  }
  .el-select {
    margin-right: 40px;
  }
}
.box2 {
  width: 240px;
  height: 32px;
  line-height: 32px;

  background: #ccc;
  display: flex;
  border-radius: 8px;
  input {
    width: 240px;
    height: 30px;
    border-style: none;
    outline: none;
    margin-left: 10px;
    background: #ccc;
    border-radius: 8px;
  }
}
.el-button--primary {
  margin-top: 24px;
  width: 88px;
  height: 30px;
  line-height: 5px;
  float: right;
  margin-bottom: 20px;
}
.lstse {
  width: 300px;
  display: flex;
  margin-top: 20px;
  .el-select {
    width: 152px;
  }
  span {
    width: 75px;
  }
}

</style>